#ifndef CADREROLL_H
#define CADREROLL_H

#include <QWidget>
#include "rollcreatedialog.h"
#include <QSqlQueryModel>
#include "rolleditdialog.h"
#include "resulttablemodel.h"

namespace Ui {
class CadreRoll;
}

class CadreRoll : public QWidget
{
    Q_OBJECT

public:
    explicit CadreRoll(QWidget *parent = 0);
    ~CadreRoll();
    RollCreateDialog *createDialog;
    RollEditDialog *editDialog;
    void initTableView(QStringList ids= QStringList(),int selectrow=0);
    int currentRoll;
    QString flags;

private slots:

    void on_lockPushButton_clicked();

    void on_addPushButton_clicked();

    void on_rollTableView_clicked(const QModelIndex &index);

    void on_deletePushButton_clicked();

    void on_editPushButton_clicked();

    void on_searchPushButton_clicked();

    void on_expertPushButton_clicked();

private:
    Ui::CadreRoll *ui;
    QSqlQueryModel *rollModel;
    int lastIndex;
    void initCadreRollTableView();
    QString saveHtmlToPDF();
    ResultTableModel *cadrerollMode;
    QHash<int,QString> uniqueCadre();
};

#endif // CADREROLL_H
